$(function(){
	getData();
	//组织联动
	
	// 返回
	$("#back").click(function(){
		var url='postList.do?ran='+Math.random();
		tl_config.loadToWorkArea(url);
	});
	
});

//插入保存
function updSave() {
	var token=localStorage.getItem("token");
	var orgId = $("#orgId5").val()?$("#orgId5").val():$("#orgId4").val()?$("#orgId4").val():$("#orgId3").val()?$("#orgId3").val():$("#orgId2").val()?$("#orgId2").val():$("#orgId1").val();
    var id = $("body").data("id");
	var username=localStorage.getItem("username");
	if (checkPostName()&&checkOrgName()&&checkPostDesc()){
	$.ajax(	
		{
		type : 'GET',
		contentType : 'application/json',
		data : {
			id :id,
			orgId : orgId,
			postName :$("#postName").val(),
			postDesc :$("#postDesc").val(),
			addUser: username,
			token:token
		},
		
		url : server_url + 'rest/postEditSave.do?ran=' + Math.random(),
		dataType : 'json',
		success : function(data) {
			if(data.retCode=="0000"){
				var url='postList.do?ran='+Math.random();
				tl_config.loadToWorkArea(url);
			}else{
				easyDialog.open({
					container:{
						header:'温馨提示',
						content:data.retMsg
					},
					autoClose : 2000
				});
			}
		}
         
	});
}
}


